<?php

declare(strict_types=1);

namespace App\Model\Users;

use App\Model\Model;
use App\Traits\Model\Users\User as UserTraits;

/**
 * @property int $id
 * @property int $shop_id 店铺ID
 * @property string $mobile 手机号码
 * @property string $nickname 昵称
 * @property string $password 密码
 * @property int $sex 性别|["未知","男","女"]
 * @property string $birthday 生日
 * @property string $consumption_amount 累计消费
 * @property int $status 状态|{"1":"正常","2":"禁用","3":"冻结"}
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class User extends Model
{
    use UserTraits;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'user';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'mobile', 'shop_id', 'nickname', 'password', 'sex', 'birthday', 'consumption_amount', 'status', 'created_at', 'updated_at', 'deleted_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'shop_id' => 'integer', 'sex' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 自动新增
     * @var array|string[]
     */
    public array $insert = [
        'shop_id'
    ];
}
